package cn.sofwin.day0118.homework.LOL;

public class Hero {
    int exp = 0;
    int level = 1;
    int atk = 500;

    public void showInfo(){
        System.out.println("英雄属性：");
        System.out.println("经验值：" + exp + "\t等级：" + level + "\t\t攻击力：" + atk);
    }
    public void attack(Monster monster){// 每攻击一次，怪物掉血，经验值+50
        monster.hp -= atk;
        exp += 50;
    }
    public void upLevel(){// 每升一级，攻击力+500，经验值归零
        level++;
        atk += 500;
        exp = 0;

    }
}
